home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol E-14 / Vol E-14.iso / games / reelgold.swf / scripts / frame_3 / DoAction.as
Text File  |  2014-03-11  |  1KB  |  58 lines

  1. function atan(mx, my, cx, cy)
  2. {
  3.    dx = mx - cx;
  4.    dy = my - cy;
  5.    at = Math.atan(dy / dx) * 180 / 3.141592653589793;
  6.    if(dx >= 0)
  7.    {
  8.       if(dy >= 0)
  9.       {
  10.          angle = at;
  11.       }
  12.       else
  13.       {
  14.          angle = at + 360;
  15.       }
  16.    }
  17.    if(dx < 0)
  18.    {
  19.       if(dy > 0)
  20.       {
  21.          angle = at + 180;
  22.       }
  23.       else
  24.       {
  25.          angle = at + 180;
  26.       }
  27.    }
  28.    return angle;
  29. }
  30. function fAddGold(who)
  31. {
  32.    pGold.push(who);
  33. }
  34. function fAddRock(who)
  35. {
  36.    pRocks.push(who);
  37. }
  38. function fSetLevel()
  39. {
  40.    pLevelText = "level " + pLevel;
  41. }
  42. getURL("FSCommand:allowscale",false);
  43. getURL("FSCommand:allowscale",false);
  44. pSlideAdd = 0;
  45. pScoreText = "";
  46. score = 0;
  47. pGold = [];
  48. pRocks = [];
  49. _global.fGetDistance = function(a, b)
  50. {
  51.    var _loc1_ = b;
  52.    var _loc2_ = a;
  53.    return Math.sqrt((_loc2_.x - _loc1_.x) * (_loc2_.x - _loc1_.x) + (_loc2_.y - _loc1_.y) * (_loc2_.y - _loc1_.y));
  54. };
  55. pLevel = 1;
  56. pLevelText = "";
  57. fSetLevel();
  58.